using System;
using System.Collections.Generic;
using System.Text;
using Shc.Sql;
using Shc.Json;
namespace CLZ.Data
{
	public static class TableDistributionCosts
	{
		public const string Table = "DistributionCosts";
		public const string DistributionCostsID = "DistributionCostsID";
		public const string SValue = "SValue";
		public const string EValue = "EValue";
		public const string Costs = "Costs";
		public const string Description = "Description";
	}
	
	[Serializable]
	public class BaseDistributionCosts
		: IDbSessionEntity, IJsonClass
	{
		int m_DistributionCostsID;
		/// <summary>
        /// 
        /// </summary>
        public int DistributionCostsID
        {
            get { return m_DistributionCostsID; }
            set { m_DistributionCostsID = value; }
        }
		
		double m_SValue;
		/// <summary>
        /// 
        /// </summary>
        public double SValue
        {
            get { return m_SValue; }
            set { m_SValue = value; }
        }
		
		double m_EValue;
		/// <summary>
        /// 
        /// </summary>
        public double EValue
        {
            get { return m_EValue; }
            set { m_EValue = value; }
        }
		
		double m_Costs;
		/// <summary>
        /// 
        /// </summary>
        public double Costs
        {
            get { return m_Costs; }
            set { m_Costs = value; }
        }
		
		string m_Description;
		/// <summary>
        /// 
        /// </summary>
        public string Description
        {
            get { return m_Description; }
            set { m_Description = value; }
        }
		
		
		#region IDbSessionEntity Members
		public void ReadDBData(RowDataReader reader)
        {
            m_DistributionCostsID = reader[TableDistributionCosts.DistributionCostsID];
            m_SValue = reader[TableDistributionCosts.SValue];
            m_EValue = reader[TableDistributionCosts.EValue];
            m_Costs = reader[TableDistributionCosts.Costs];
            m_Description = reader[TableDistributionCosts.Description];
        }
		
		public void WriteDBData(RowDataWriter writer)
        {
            writer.SetPrimaryKey(TableDistributionCosts.DistributionCostsID, PrimaryKeyType.Identity, DistributionCostsID);
			writer[TableDistributionCosts.SValue] = SValue;
			writer[TableDistributionCosts.EValue] = EValue;
			writer[TableDistributionCosts.Costs] = Costs;
			writer[TableDistributionCosts.Description] = Description;
        }

        public void SetIdentityAfterInsert(DBObject idd)
        {
            m_DistributionCostsID = idd;
        }
		
		public string TableName
        {
            get { return TableDistributionCosts.Table; }
        }
		#endregion
		
		#region IJsonClass Members

        public void JsonDeSerializeObj(JsonHashTable hashToRead)
        {
             m_DistributionCostsID = hashToRead["DistributionCostsID"];
			 
             m_SValue = hashToRead["SValue"];
			 
             m_EValue = hashToRead["EValue"];
			 
             m_Costs = hashToRead["Costs"];
			 
             m_Description = hashToRead["Description"];
			 
        }

        public void JsonSerializeObj(JsonHashTable hashToFill)
        {
            hashToFill["DistributionCostsID"] = DistributionCostsID;
			 
            hashToFill["SValue"] = SValue;
			 
            hashToFill["EValue"] = EValue;
			 
            hashToFill["Costs"] = Costs;
			 
            hashToFill["Description"] = Description;
			 
        }

        #endregion
		
	}
}
